home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat3 / setregid.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  1.9 KB  |  47 lines

  1.  
  2. SETREGID(3)                UNIX Programmer's Manual                SETREGID(3)
  3.  
  4. NNAAMMEE
  5.      sseettrreeggiidd - set real and effective group ID's
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<uunniissttdd..hh>>
  9.  
  10.      _i_n_t
  11.      sseettrreeggiidd(_i_n_t _r_g_i_d, _i_n_t _e_g_i_d)
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      The real and effective group ID's of the current process are set to the
  15.      arguments.  Unprivileged users may change the real group ID to the effec-
  16.      tive group ID and vice-versa; only the super-user may make other changes.
  17.  
  18.      Supplying a value of -1 for either the real or effective group ID forces
  19.      the system to substitute the current ID in place of the -1 parameter.
  20.  
  21.      The sseettrreeggiidd() function was intended to allow swapping the real and ef-
  22.      fective group IDs in set-group-ID programs to temporarily relinquish the
  23.      set-group-ID value.  This function did not work correctly, and its pur-
  24.      pose is now better served by the use of the sseetteeggiidd() function (see
  25.      setuid(2)).
  26.  
  27.      When setting the real and effective group IDs to the same value, the
  28.      standard sseettggiidd() function is preferred.
  29.  
  30. RREETTUURRNN VVAALLUUEESS
  31.      Upon successful completion, a value of 0 is returned.  Otherwise, a value
  32.      of -1 is returned and _e_r_r_n_o is set to indicate the error.
  33.  
  34. EERRRROORRSS
  35.      [EPERM]       The current process is not the super-user and a change oth-
  36.                    er than changing the effective group-id to the real group-
  37.                    id was specified.
  38.  
  39. SSEEEE AALLSSOO
  40.      getgid(2),  setegid(2),  setgid(2),  setuid(2)
  41.  
  42. HHIISSTTOORRYY
  43.      The sseettrreeggiidd() function call appeared in 4.2BSD and was dropped in
  44.      4.4BSD.
  45.  
  46. 4.2 Berkeley Distribution       March 10, 1991                               1
  47.